Monad-Independent Hoare Logic in HASCASL

نویسندگان

  • Lutz Schröder
  • Till Mossakowski
چکیده

Monads have been recognized by Moggi as an elegant device for dealing with stateful computation in functional programming languages. It is thus natural to develop a Hoare calculus for reasoning about computational monads. While this has previously been done only for the state monad, we here provide a generic, monad-independent approach, which applies also to further computational monads such as exceptions, input/output, and non-determinism. All this is formalized within the logic of HasCasl, a higher-order language for functional specification and programming. Combination of monadic features can be obtained by combining their loose specifications. As an application, we prove partial correctness of Dijkstra’s nondeterministic version of Euclid’s algorithm in a monad with nondeterministic dynamic references.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

HasCasl: Integrated higher-order specification and program development

We lay out the design of HasCasl, a higher order extension of the algebraic specification language Casl that serves both as a wide-spectrum language for the rigorous specification and development of software, in particular but not exclusively in modern functional programming languages, and as an expressive standard language for higher-order logic. Distinctive features of HasCasl include partial...

متن کامل

Monad-Independent Dynamic Logic in Has Casl

Monads have been recognized by Moggi as an elegant device for dealing with stateful computation in functional programming languages. In previous work, we have introduced a Hoare calculus for partial correctness of monadic programs. All this has been done in an entirely monad-independent way. Here, we extend this to a monad-independent dynamic logic (assuming a moderate amount of additional infr...

متن کامل

Completeness of monad-based dynamic logic

Monads are used in functional programming as a means of modeling and encapsulating computational effects at an appropriate level of abstraction. In previous work, we have introduced monad-based dynamic logic and have used it for the specification and verification of various monadic functional-imperative algorithms over different monads. The semantics of this logic was originally defined over pa...

متن کامل

Dijkstra and Hoare monads in monadic computation

The Dijkstra and Hoare monads have been introduced recently for capturing weakest precondition computations and computations with preand post-conditions, within the context of program verification, supported by a theorem prover. Here we give a more general description of such monads in a categorical setting. We first elaborate the recently developed view on program semantics in terms of a trian...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2003